import java.util.*;

/**
 * @author LKQ
 * @date 2022/3/22 20:49
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.toHex(26);
    }

    public String toHex(int num) {
        if (num == 0) {
            return "0";
        }
        StringBuilder sb = new StringBuilder();
        while (num != 0) {
            int u = num & 15;
            char c = (char) (u + '0');
            if (u >= 10) {
                c = (char) (u - 10 + 'a');
            }
            sb.append(c);
            num >>>= 4;
        }
        return sb.reverse().toString();
    }
}
